import Vue from 'vue';
import Router from 'vue-router';
Vue.use(Router);



export const constantRoutes = [
    {
    	path: '/login',

    	component: () => import('../views/login')
    },
    // {
    //     path: '/rzsh',
    //     component: () =>
    //         import ('../views/rzsh'),
    // },
    {
        path: '/',
        component: () =>
            import ('../views/myrenzheng'),
    },
    // {
    //     path: '/rzxxsh',
    //     component: () =>
    //         import ('../views/rzxxsh'),
    // },

];

const createRouter = () =>
    new Router({
        // base: '/xs_demo',
        // mode: 'history', // require service support
        // scrollBehavior: () => ({ y: 0 }),
        routes: constantRoutes,
    });

const router = createRouter();
// async function addH5shenpi() {
//   let s = await import("xunshuthird/h5shenpi");

//   s = s.default;
//   // s.path = "/";
//   // if (s.children.length) {
//   //   s.redirect = s.children[0].path;
//   // }
//   router.addRoutes(s);
// }
//addH5shenpi();
// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export function resetRouter() {
    const newRouter = createRouter();
    router.matcher = newRouter.matcher; // reset router
}

export default router;